<?php

namespace app\common\service\SystemConfigService\Area;

use app\model\BbcModel\Area;
use app\Normal;

class AreaService
{
    public function arealists($param){
        if (empty($param['cid'])) {
            return Normal::returnCode(Normal::FAIL, 'cid必传');
        }
        $data_list = Area::instance()->lists(['_fields_'=>'id,name,pid']);

        $tree_lists = tree($data_list,0,'id','pid');
        return Normal::returnCode(Normal::SUC,'获取成功',$tree_lists);
    }
}